<template>
<div>
    <div>
        <router-link :to="'/hotel/ratation/'">
            <el-button size="mini" type="primary" icon="el-icon-edit">增加轮播图</el-button>
        </router-link>
    </div>
    <el-table :data="ratationList" border fit highlight-current-row>
        <el-table-column align="center" label="id" prop="id">
        </el-table-column>
        <el-table-column align="center" label="图片链接地址" prop="url">
        </el-table-column>
        <el-table-column align="center" label="img" :src="url">
        </el-table-column>

        <el-table-column align="center" label="操作">
            <template slot-scope="scope">

                <el-button size="mini" type="danger" icon="el-icon-delete" @click="removeById(scope.row.id)">删除</el-button>
            </template>

        </el-table-column>
    </el-table>
</div>
</template>

<script>
export default {
    data: function () {
        return {
            ratationList: [],
            url: "http://localhost:8081/hotel/ratation/getAll"
        }
    },
    mounted() {
        this.getRatation();
    },
    methods: {
        getRatation() {
            this.axios.get(this.url).then(res => {
                console.log(res);
                this.ratationList = res.data.data.ratations;

            })
        },
        removeById(id) {

        }
    }

}
</script>

<style>

</style>
